@include('header')
<link rel="stylesheet" href="{{URL::asset('css/handbook.css')}}">


<div class="container" style="">

	<!-- 左侧导航标题栏 -->
@include('web.typelist')
	<!-- 右侧内容 -->
	<div class="col-md-10">
		<div class="news-title">
			<p class="news" style="padding-left:10px;font-weight: 700">
				<a href="/" title="回到首页"><span>首页</span></a>
				<span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span>
				{{$handbook->type_name}}
			</p>
		</div>
		@if($handbook)
		@foreach($handbook as $v)
		<div class="news-content" style="width: 85%;">
			<div class="news-img-left">
				<img style="margin: 0;opacity:0.7;width: 80px;height: 80px;" src="{{$v->img_url}}" class="img-responsive" alt="Cinque Terre">
			</div>
			<a href="javascript:void(0);" onclick="getInfo({{$v->id}})">
				<div class="news-content-right ">
					<div class="news-content-title">
						{{$v->title}}
					</div>
					<div class="news-content-nei" style="font-size: 12px;">
						{{$v->desc_con}}
					</div>
					<div class="news-content-des">
						<span>[ {{$v->type->type_name}} ]</span>
						<span style="margin-left: 10px;">[ {{$v->created_at}} ]</span>
					</div>
				</div>
			</a>
		</div>
		@endforeach
		<!-- 分页 -->
		<div class="pages-content" style="width: 100%;">
			<nav aria-label="Page navigation" style="float: right;margin-right: 15%;">
				<ul class="pagination">
					@if(isset($handbook->t_con))
						{{$handbook->appends(['username' => $handbook->username,'t_con'=>$handbook->t_con])->links()}}
					@else
						{{$handbook->appends(['username' => $handbook->username,'type_id'=>$handbook->type_id])->links()}}
					@endif
				</ul>
			</nav>
		</div>

		@else
			<div class="news-content" style="margin:0 36%;">
				<div class="" style="min-width: 500px;font-size: 18px;padding: 30px 0;">暂无数据</div>
			</div>
		@endif

	</div>


</div>
<script>
	function getInfo(id){

	var user = JSON.parse(sessionStorage.getItem("users"));
	if(!user){
		window.location.href = '/login';
	}else{
		window.location.href = '/info?username='+user.username+'&id='+id;
	}
	}
</script>

@include('footer')
